<html>
<head><meta charset="utf-8"><title>test does not run when IDE button clicked · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html">test does not run when IDE button clicked</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="228398053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228398053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228398053">(Mar 02 2021 at 12:03)</a>:</h4>
<p><a href="/user_uploads/4715/lMXecNprOA3bLpyNCUz0CeKA/Screenshot-2021-03-02-at-12.02.45.png">Screenshot-2021-03-02-at-12.02.45.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/lMXecNprOA3bLpyNCUz0CeKA/Screenshot-2021-03-02-at-12.02.45.png" title="Screenshot-2021-03-02-at-12.02.45.png"><img src="/user_uploads/4715/lMXecNprOA3bLpyNCUz0CeKA/Screenshot-2021-03-02-at-12.02.45.png"></a></div>



<a name="228398163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228398163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228398163">(Mar 02 2021 at 12:04)</a>:</h4>
<p>I have the following test in a file which is a rust keyword, it runs if you run <code>cargo test</code>. However, when the <code>Run test</code> button is clicked in vscode it seems to be filtered out</p>



<a name="228398284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228398284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228398284">(Mar 02 2021 at 12:05)</a>:</h4>
<p>Also running <code>cargo test {TESTNAME}</code> runs the test. So maybe the button is doing something different?</p>



<a name="228398301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228398301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228398301">(Mar 02 2021 at 12:05)</a>:</h4>
<p>Are you using <code>rust-analyzer</code>?</p>



<a name="228398312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228398312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228398312">(Mar 02 2021 at 12:05)</a>:</h4>
<p>Yep. (Ah posted in the wrong topic)</p>



<a name="228398518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228398518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228398518">(Mar 02 2021 at 12:07)</a>:</h4>
<p>Do you get a <code>cargo</code> invocation in one of the Output window channels?</p>



<a name="228398605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228398605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228398605">(Mar 02 2021 at 12:08)</a>:</h4>
<p>Or in the terminal</p>



<a name="228398610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228398610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228398610">(Mar 02 2021 at 12:08)</a>:</h4>
<p><a href="/user_uploads/4715/LZl085euuUZnTeq0arlNXM3c/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/LZl085euuUZnTeq0arlNXM3c/image.png" title="image.png"><img src="/user_uploads/4715/LZl085euuUZnTeq0arlNXM3c/image.png"></a></div>



<a name="228398616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228398616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228398616">(Mar 02 2021 at 12:08)</a>:</h4>
<p>Like this</p>



<a name="228398641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228398641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228398641">(Mar 02 2021 at 12:08)</a>:</h4>
<p>I get:</p>
<div class="codehilite"><pre><span></span><code>Executing task: cargo test --package test_proj --lib --all-features -- if::test_in_if --exact --nocapture
</code></pre></div>



<a name="228398682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228398682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228398682">(Mar 02 2021 at 12:08)</a>:</h4>
<p><a href="/user_uploads/4715/wHs5gZv80-DLCyLwAH6szmlQ/Screenshot-2021-03-02-at-12.08.39.png">Screenshot-2021-03-02-at-12.08.39.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/wHs5gZv80-DLCyLwAH6szmlQ/Screenshot-2021-03-02-at-12.08.39.png" title="Screenshot-2021-03-02-at-12.08.39.png"><img src="/user_uploads/4715/wHs5gZv80-DLCyLwAH6szmlQ/Screenshot-2021-03-02-at-12.08.39.png"></a></div>



<a name="228398739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228398739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228398739">(Mar 02 2021 at 12:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="369769">kev</span> <a href="#narrow/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked/near/228398641">said</a>:</p>
<blockquote>
<p>I get:</p>
<p><div class="codehilite"><pre><span></span><code>Executing task: cargo test --package test_proj --lib --all-features -- if::test_in_if --exact --nocapture
</code></pre></div><br>
</p>
</blockquote>
<p>So something must be wrong there</p>



<a name="228399028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228399028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228399028">(Mar 02 2021 at 12:12)</a>:</h4>
<p>It seems to only happen when the file is named after a rust keyword. The same thing happens if the file is named <code>for</code></p>
<div class="codehilite"><pre><span></span><code>Executing task: cargo test --package ide_bug --lib --all-features -- for::test_in_for --exact --nocapture
</code></pre></div>



<a name="228399107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228399107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228399107">(Mar 02 2021 at 12:12)</a>:</h4>
<p>TBH, I had no idea you could call a module <code>if</code></p>



<a name="228399176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228399176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228399176">(Mar 02 2021 at 12:13)</a>:</h4>
<p>with <code>r#</code> you can call anything after any keyword IIRC</p>



<a name="228399200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228399200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228399200">(Mar 02 2021 at 12:13)</a>:</h4>
<p>you couldn't before 2018</p>



<a name="228399229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228399229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228399229">(Mar 02 2021 at 12:13)</a>:</h4>
<p>Ah, so you still need the <code>r#</code>, that makes sense</p>



<a name="228399261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228399261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228399261">(Mar 02 2021 at 12:14)</a>:</h4>
<p>So it looks like a <del><code>cargo</code></del> <code>libtest</code> bug?</p>



<a name="228399320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228399320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228399320">(Mar 02 2021 at 12:14)</a>:</h4>
<p><code>module_path!()</code> returns an <code>r#</code> identifier here, so we probably have to include this in the test path</p>



<a name="228399346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228399346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228399346">(Mar 02 2021 at 12:14)</a>:</h4>
<p>might be a libtest bug though</p>



<a name="228399361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228399361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228399361">(Mar 02 2021 at 12:14)</a>:</h4>
<p><code>cargo test --package test_proj --lib --all-features -- "r#if::test_in_if" --exact --nocapture</code> ?</p>



<a name="228399372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228399372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228399372">(Mar 02 2021 at 12:14)</a>:</h4>
<p>yeah, does that work?</p>



<a name="228399397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228399397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228399397">(Mar 02 2021 at 12:15)</a>:</h4>
<p>Wait, you might need to escape it</p>



<a name="228399466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/test%20does%20not%20run%20when%20IDE%20button%20clicked/near/228399466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked.html#228399466">(Mar 02 2021 at 12:15)</a>:</h4>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> <a href="#narrow/stream/122651-general/topic/test.20does.20not.20run.20when.20IDE.20button.20clicked/near/228399361">said</a>:</p>
<blockquote>
<p><code>cargo test --package test_proj --lib --all-features -- "r#if::test_in_if" --exact --nocapture</code> ?</p>
</blockquote>
<p>This works for me; with and without the quotes</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>